// src/router/index.js
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import Login from '@/page/login/index.vue'
import Home from '@/page/home/index.vue'
import PrivacyPage from '@/page/login/privacyPage.vue'

const routes = [
  // 路由配置保持不变
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/privacy',
    name: 'Privacy',
    component: PrivacyPage
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/'
  }
]

const router = createRouter({
  // 关键修改：将history模式改为hash模式
  // history: createWebHistory('/charge/'),
  history: createWebHashHistory('/charge/'),  // 使用哈希模式
  routes
})

export default router